<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-model结合select</title>
</head>
<body>

<div id="app">
  <h2>单选</h2>
  <select name="acb"  v-model="fruit">
    <option value="香蕉">香蕉</option>
    <option value="苹果">苹果</option>
    <option value="榴莲">榴莲</option>
    <option value="菠萝">菠萝</option>
  </select>
  <h2>你选择的是：{{fruit}}</h2>
  <hr>
  <h2>多选</h2>
  <select name="acb"  v-model="fruits" multiple>
    <option value="香蕉">香蕉</option>
    <option value="苹果">苹果</option>
    <option value="榴莲">榴莲</option>
    <option value="菠萝">菠萝</option>
  </select>
  <h2>你选择的是：{{fruits}}</h2>


  <h2>值绑定 v-bind:value  ，从服务器获取数组的值，然后动态绑定到checkbox选项</h2>
  <label :for="item" v-for="item in hobbies">
    <input type="checkbox" :id="item" :value="item" v-model="fruits">{{item}}
  </label>

</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '你好',
      fruit: '苹果',
      fruits: [],
      hobbies: ['篮球', '高尔夫球', '羽毛球', '足球', '排球']
    }
  })
</script>
</body>
</html>
